import React, { useEffect, useState } from 'react';
import DescriptionsCondition from '@/components/DescriptionsCondition';
import DrawerCondition from '@/components/DrawerCondition';
import PopImgShow from '@/components/PopImgShow';
import TableDataBlock from '@/components/TableDataBlock';
import { connect } from 'umi';
import { Space, Tag } from 'antd'
import { order_status, pay_type, operation_statusinfo } from '@/common/contact';
import ImagePreviewGroup from '@/components/DescriptionsCondition/ImagePreviewGroup';
const PointDetail = (props) => {
  const { dispatch, list = [], onClose } = props;
  const getColumns = [
    // {
    //   title: '订单编号',
    //   dataIndex: 'orderSn',
    // },
    {
      title: '支付金额',
      dataIndex: 'payFee',
    },
    {
      title: '支付时间',
      dataIndex: 'payTime',
    },
    {
      title: '状态',
      dataIndex: 'status',
      render: (e) => {
        return operation_statusinfo[e]
      }
    },
    {
      title: '支付方式',
      dataIndex: 'payType',
      render: (e) => {
        return pay_type[e]
      }
    },
    {
      title: '凭证图片',
      dataIndex: 'certificateImages',
      render: (e) => {
        return <ImagePreviewGroup width={40} height={40} url={e}></ImagePreviewGroup>
      }
    },
    {
      title: '是否补费',
      dataIndex: 'orderRechargeFlag',
      render: (e) => {
        if (e === '1') {
          return <Tag style={{ textAlign: 'center' }} color="#f50">是</Tag>
        } else if (e === '2') {
          return <Tag style={{ textAlign: 'center' }} color="#87d068">否</Tag>
        }
        else if (e === '3') {
          return '售后补费'
        }
        else return '--'
      }
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
    },
    {
      title: '用户姓名',
      dataIndex: 'username',
    },
    {
      title: '头像',
      dataIndex: 'profile',
      render: (e) => {
        return <PopImgShow url={e}></PopImgShow>
      }
    },
    {
      title: '手机',
      dataIndex: 'mobile',
    },
    {
      title: '创建员工',
      dataIndex: 'addAdminName',
    },
    {
      title: '审核员工',
      dataIndex: 'checkAdminName',
    },
    {
      title: '审核时间',
      dataIndex: 'checkTime',
    },
  ];

  return (
    <TableDataBlock
      // searchItems={searchItems}
      columns={getColumns}
      list={list}
      rowKey={(record) => `${record.id}`}
    ></TableDataBlock>
  );
};
export default connect(({ subscriber, loading }) => ({
  loading: loading.effects['subscriber/fetchUserDetail'],
}))(PointDetail);;
